package com

import (
	"bp/conf"
	"bp/db"
	"bp/internal/nsqserver/producer"
	nsqMallCom "bp/internal/service/com/nsqMall"
	nsqPayCom "bp/internal/service/com/nsqPay"
	"bp/internal/service/entity"
	"go.uber.org/zap"
)

type ComHubForNsq struct {
	slog              *zap.SugaredLogger
	NsqMallService   *nsqMallCom.NsqMallComServiceImp
	NsqPayService    *nsqPayCom.NsqPayComServiceImp
}

// NewComHubForNsq initialization
func NewComHubForNsq(
	slog *zap.SugaredLogger,
	pgdao *db.PgDao,
	vars *conf.VarsSection,
	pub *producer.NsqProducerProxy,
	entityHub *entity.EntityHub,
	// proxy *client.GrpcClientProxy,
	// adp *cache.Adapter,
) (hub *ComHubForNsq) {

	hub = &ComHubForNsq{
		slog:              slog.With("module", "ComHubForNsq"),
		NsqMallService:   nsqMallCom.New(pgdao, slog, vars, entityHub),
		NsqPayService:    nsqPayCom.New(pgdao, slog, vars, entityHub),
		// cacher:           adp,
		// activityService: activityService,
	}

	return
}
